#ifndef _BUOLA_MEDIA_CODEC_BMP3DECODER_H_
#define _BUOLA_MEDIA_CODEC_BMP3DECODER_H_

#include <buola/bbox/bservice.h>
#include <buola/bbox/bstreamin.h>
#include <buola/bbox/bstreamout.h>

namespace buola { namespace media {

class BMP3Decoder : public bbox::BService<BMP3Decoder>
{
    struct SImpl;

public:
    BMP3Decoder();
    ~BMP3Decoder();

    void PushedBufferCB(const CBuffer<uint8_t> &pBuffer);

private:
    std::unique_ptr<SImpl> mP;

public:
    BStreamIn<uint8_t> iData;
    BStreamOut<int16_t> oWave;
};

/*namespace media*/ } /*namespace buola*/ }

#endif

#if 0

struct _GstMad
{
  GstElement element;

  /* pads */
  GstPad *sinkpad, *srcpad;

  /* state */
  struct mad_stream stream;
  struct mad_frame frame;
  struct mad_synth synth;
  guchar *tempbuffer;           /* temporary buffer to serve to mad */
  glong tempsize;               /* running count of temp buffer size */
  GstClockTime last_ts;
  guint64 base_byte_offset;
  guint64 bytes_consumed;       /* since the base_byte_offset */
  guint64 total_samples;        /* the number of samples since the sync point */

  gboolean in_error;            /* set when mad's in an error state */
  gboolean restart;
  gboolean discont;
  guint64 segment_start;
  GstSegment segment;
  gboolean need_newsegment;

  /* info */
  struct mad_header header;
  gboolean new_header;
  guint framecount;
  gint vbr_average;             /* average bitrate */
  guint64 vbr_rate;             /* average * framecount */

  gboolean half;
  gboolean ignore_crc;

  GstTagList *tags;

  /* negotiated format */
  gint rate, pending_rate;
  gint channels, pending_channels;
  gint times_pending;

  gboolean caps_set;            /* used to keep track of whether to change/update caps */
#ifndef GST_DISABLE_INDEX
  GstIndex *index;
  gint index_id;
#endif

  gboolean check_for_xing;
  gboolean xing_found;

  gboolean framed;              /* whether there is a demuxer in front of us */

  GList *pending_events;
};
#endif
